#ifdef AMBER_USE_CAFFE_BLOB
#define CPU_ONLY
#include <caffe/caffe.hpp>
#endif // AMBER_USE_CAFFE_BLOB

#include <iostream>
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>

using namespace cv;
using namespace std;

namespace amber {
class Image {
public:
    Image();
    Image(cv::Mat image, string name = "lovely amber");
    Image(std::string data, std::string name = "lovely amber");
#ifdef AMBER_USE_CAFFE_BLOB
    Image(caffe::Blob<float>* blob, int width, int height, std::string name = "lovely amber");
#endif // AMBER_USE_CAFFE_BLOB

    /**
     * 功能：合并图片专用，这个仅是简陋的图片 从左到右 从上到下 填充到背景的功能
     * 返回：vector<cv::Mat> 
    */
    Image(std::vector<Image> list, int width, int height, std::string name = "lovely amber");
    void Show()
    {
        Image::Show(this->image);
    };
    const void Show(cv::Mat image, string name = "lovely amber", int waitKey = 0)
    {
        cv::imshow(name, image);
        cv::waitKey(waitKey);
    };

    cv::Mat Crop(int startRow, int startCol, int width, int height);

    /**
     * 功能：分割图片
     * 返回：vector<cv::Mat> 
    */

    std::vector<Image> Split(int width, int height, bool filling = false);
#ifdef AMBER_USE_CAFFE_BLOB
    caffe::Blob<float>* asBlob();
#endif // AMBER_USE_CAFFE_BLOB

    cv::Mat image;

private:
    string name = "lovely amber";
};
};
